package ${package.Controller}.dto;

<#list table.importPackages as pkg>
import ${pkg};
</#list>
import com.example.infrastructure.excel.ExcelExportable;
import com.example.infrastructure.excel.ExcelImportable;
import cn.idev.excel.annotation.ExcelProperty;
<#if swagger>
import io.swagger.v3.oas.annotations.media.Schema;
</#if>
<#if entityLombokModel>
import lombok.Data;
</#if>
import jakarta.validation.constraints.*;

/**
 * ${table.comment!} DTO
 *
 * @author ${author}
 * @since ${date}
 */
<#if entityLombokModel>
@Data
</#if>
<#if swagger>
@Schema(name = "${entity}DTO", description = "${table.comment!}DTO")
</#if>
public class ${entity}DTO implements ExcelExportable, ExcelImportable {

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if !field.keyFlag>
    <#if field.comment!?length gt 0>
        <#if swagger>
    @Schema(description = "${field.comment}")
        <#else>
    /**
     * ${field.comment}
     */
        </#if>
    </#if>
    @ExcelProperty("${field.comment!field.propertyName}")
    <#if field.propertyType == "String">
    @NotBlank(message = "${field.comment!field.propertyName}不能为空")
    <#elseif field.propertyType?contains("Long") || field.propertyType?contains("Integer")>
    @NotNull(message = "${field.comment!field.propertyName}不能为空")
    </#if>
    private ${field.propertyType} ${field.propertyName};
    
    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
}
